package com.lichi.zabbix.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author lichi
 * @create 2020-05-28 8:43
 */
@Component
@Order(value = 1)
public class StartService implements ApplicationRunner {

    public static Logger logger = LoggerFactory.getLogger(StartService.class);

    @Autowired
    ZabbixService zabbixService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        logger.info("=========== 项目启动后，初始化 zabbix =============");
        zabbixService.init();
    }
}
